package find.prj.lib;

import java.util.ArrayList;

public class GraphRoute extends Graph {
	
	protected int Length;
	
	public GraphRoute() {
		this.Length = 0;
		this.Nodes = new ArrayList<GraphNode>();
	}
	
	public GraphRoute (GraphRoute route) {
		this.Length = route.Length;
		this.Nodes.addAll(route.Nodes);
	}
	
	public int getLength() { return this.Length; }
	
	@Override
	public String toString() {
		StringBuilder string = new StringBuilder();
		for (GraphNode node : this.Nodes)
			string.append(node.Name + " - ");
		return string.replace(string.length()-3, string.length(), "\nLength = "+this.Length).toString();
	}

}